<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.lmpop.trade.tb_commpara.Tb_commparaInfo" %>
<%@page import="com.lmpop.trade.ts_category.*" %>
<%@page import="com.lmpop.trade.ti_brand.Ti_brandInfo" %>
<%@page import="com.lmpop.trade.tb_ordergoods.Tb_ordergoodsInfo" %>
<%@page import="com.lmpop.trade.ti_orderinfo.*" %>
<%@page import="com.lmpop.trade.ti_attach.Ti_attachInfo" %>
<%@page import="com.lmpop.trade.ts_categoryattr.Ts_categoryattrInfo" %>
<%@page import="com.lmpop.trade.ts_area.*" %>
<%@ page import="com.lmpop.frame.util.Config" %>
<%@ page import="com.lmpop.trade.tb_commpara.Tb_commparaInfo" %>
<%@page import="com.lmpop.createIndex.search.B2CHelpIndexFiles"%>
<jsp:useBean id="randomId" class="com.lmpop.frame.util.RandomID" scope="page" /><%@ page import="com.lmpop.trade.ti_evaluate.Ti_evaluateInfo" %>
<%
   
  
  
  
  String order_no=""; 
	
	if(request.getParameter("order_no")!=null )
	{
	   order_no  =request.getParameter("order_no");		
	}
 
	
	
	   
  Tb_ordergoodsInfo tb_ordergoodsInfo =new Tb_ordergoodsInfo(); 
  
 
    Ti_orderinfoInfo ti_orderinfoInfo = new Ti_orderinfoInfo();
    List list = ti_orderinfoInfo.getListByPk(order_no);

  	HashMap map = new HashMap();
  	if(list!=null && list.size()>0) map = (HashMap)list.get(0);
  	String order_source="",order_state="",consignee="",area_attr="",address="";
  	String zip_code="",tel="",cellphone="",email="",best_time="",sign_building="",shipping_id="",shipping_name="";
  	String pay_id="",pay_name="",how_oos="",all_goods_amount="",all_shipping_fee="",all_pack_fee="",all_tax_invoice="";
  	String all_total_amount="",all_user_money="",all_integral_money="",all_discount="",all_confirm_money="",cust_id="";
  	String all_paid_amount="",add_time="",user_id="";
  	if(map.get("order_no")!=null) order_no = map.get("order_no").toString();
  	if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
  	if(map.get("user_id")!=null) user_id = map.get("user_id").toString();
  	if(map.get("order_state")!=null) order_state = map.get("order_state").toString();
    if(map.get("consignee")!=null) consignee = map.get("consignee").toString();
  	//if(map.get("area_attr")!=null) area_attr = map.get("area_attr").toString();
  	if(map.get("address")!=null) address = map.get("address").toString();
  	if(map.get("zip_code")!=null) zip_code = map.get("zip_code").toString();
  	if(map.get("tel")!=null) tel = map.get("tel").toString();
  	if(map.get("cellphone")!=null) cellphone = map.get("cellphone").toString();
  	if(map.get("email")!=null) email = map.get("email").toString();
  	if(map.get("best_time")!=null) best_time = map.get("best_time").toString();
  	if(map.get("sign_building")!=null) sign_building = map.get("sign_building").toString();
  	if(map.get("shipping_id")!=null) shipping_id = map.get("shipping_id").toString();
  	if(map.get("shipping_name")!=null) shipping_name = map.get("shipping_name").toString();
  	if(map.get("pay_id")!=null) pay_id = map.get("pay_id").toString();
  	if(map.get("pay_name")!=null) pay_name = map.get("pay_name").toString();
  	if(map.get("how_oos")!=null) how_oos = map.get("how_oos").toString();
  	if(map.get("all_goods_amount")!=null) all_goods_amount = map.get("all_goods_amount").toString();
  	if(map.get("all_shipping_fee")!=null) all_shipping_fee = map.get("all_shipping_fee").toString();
  	if(map.get("all_pack_fee")!=null) all_pack_fee = map.get("all_pack_fee").toString();
  	if(map.get("all_tax_invoice")!=null) all_tax_invoice = map.get("all_tax_invoice").toString();
  	if(map.get("all_total_amount")!=null) all_total_amount = map.get("all_total_amount").toString();
  	if(map.get("all_user_money")!=null) all_user_money = map.get("all_user_money").toString();
  	if(map.get("all_integral_money")!=null) all_integral_money = map.get("all_integral_money").toString();
  	if(map.get("all_discount")!=null) all_discount = map.get("all_discount").toString();
  	if(map.get("all_confirm_money")!=null) all_confirm_money = map.get("all_confirm_money").toString();
  	if(map.get("all_paid_amount")!=null) all_paid_amount = map.get("all_paid_amount").toString();
  	if(map.get("add_time")!=null) add_time = map.get("add_time").toString();
    
   
   
   Tb_commparaInfo tb_commparaInfo = new Tb_commparaInfo();
   
  // Ti_customerInfo  ti_customerInfo  = new Ti_customerInfo();
   Ti_attachInfo  ti_attachInfo = new Ti_attachInfo();
   Ts_categoryattrInfo ts_categoryattrInfo =new Ts_categoryattrInfo(); 
                                                   
   
   Ts_areaInfo areaBean = new Ts_areaInfo();
   String areaAttr = "";
	 if (map.get("area_attr") != null) 
	 {
				area_attr = map.get("area_attr").toString();
				String areaArr[] = area_attr.split("\\|");
				for( int k = 0; k < areaArr.length; k++ )
				{
					areaAttr = areaAttr + "&nbsp;" + areaBean.getAreaNameById(areaArr[k]);
				}
	  }
 

	Tb_commparaInfo commparaInfo = new Tb_commparaInfo();
	String state_name = commparaInfo.getOneComparaPcode1("31",order_state);
	Config configa = new Config();
	String goods_article_path = configa.getString("goods_article_path");

	Ti_evaluateInfo evaluateInfo = new Ti_evaluateInfo();
	boolean isNotEvaluate = evaluateInfo.checkIsnotEvaluate(order_no);

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>雷鸣商城-订单明细</title>
<meta http-equiv="x-ua-compatible" content="ie=7" />
<link href="/templets/html/shop/css/style.css" rel="stylesheet" type="text/css" />
<link href="/templets/html/shop/css/main_right.css" rel="stylesheet" type="text/css" />
<script src="/js/jquery.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript" src="/program/plugins/calendar/WdatePicker.js"/>
</script>
<script type="text/javascript" src="return.js"></script>
</head>
<body>
<style> 
 
.listtab{margin:3px 0 3px 0;background:#ccc;} 
.listtab td{background:#F9F9F9; height:30px; padding-left:15px; padding-right:10px;} 
.glisttab{margin:3px 0 3px 0;background:#cccccc;} 
.glisttab td{background:#F9F9F9; height:30px; padding-left:15px; padding-right:10px;} 
.heightall{ height:8px; width:980px;}
 
 
</style>
<link href="/templets/html/shop/css/style.css" rel="stylesheet" type="text/css" />
<script> 
		  document.write("<s" + "cript type='text/javascript' src='/templets/html/shop/top.jsp?" + Math.random() + "'></scr" + "ipt>"); 
		</script>
<div class="w990 content">
<div class="heightall"></div>
  <div class="f-right w750">
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_main">
      <tr>
        <th width="5%" height="40" align="center"><img src="/templets/html/shop/images/icon1.gif" /></th>
        <th width="75%"><h3>订单详细信息</h3></th>
      </tr>
    </table>
    <DIV class="focus-area-setTab">
      <DIV class="focus-area-setTab-menu">
        <DIV class="clear"></DIV>
      </DIV>
      <DIV class="focus-area-setTab-content">
        <DIV id=con_one_1 >
          <table width="100%" cellspacing="0"  cellpadding="0" class="tablelist0">
            <tr bgcolor="#fcf8fb">
              <td height="100" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="1" class="listtab">
                  <tr>
                    <td  colspan="4" height="38" >&nbsp;&nbsp;<img src="/templets/html/shop/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">基本信息</span> </td>
                  </tr>
                  <tr>
                    <td  height="38" class="art_col"  align="right" width="20%" >订单号:</td>
                    <td  width="18%"><%=order_no%></td>
                    <td  height="38" class="art_col" width="12%" align="right" >订单状态:</td>
                    <td  width="60%" ><table>
                        <tr>
                          <td><%=state_name%></td>
                          <td><%
								if(order_state.equals("0")){
									
							%>
                            <%
										if(!pay_id.equals("0")){
										%>
                            <a href="javascript:pay('<%=order_no%>','<%=all_total_amount%>','<%=all_shipping_fee%>','<%=shipping_name%>','0');" >
                            <div style="background:url(/templets/html/shop/images/orderbg.jpg) repeat-x;width:57px;height:20px;line-height:20px;color:#fff;cursor:pointer;text-align:center;"> 付款</div>
                            </a>
                            <%
								} else{
							%>
                            货到付款
                            <%
							}
								}
							%>
                            <%
								if(order_state.equals("2")){
							%>
                            <a href="/doTradeReg.do?order_no=<%=order_no%>&order_state=3&bpm_id=5590">
                            <div style="background:url(/templets/html/shop/images/orderbg.jpg) repeat-x;width:57px;height:20px;line-height:20px;color:#fff;cursor:pointer;text-align:center;">确认收货</div>
                            </a>
                            <%
								}
							%>
                            <%
								if(order_state.equals("3") && isNotEvaluate){
							%>
                            <a href="/templets/html/shop/jsp/commentIndex.jsp?order_no=<%=order_no%>&cust_id=<%=cust_id%>&menu_id=4865kY45B7388tV">
                            <div style="background:url(/templets/html/shop/images/orderbg.jpg) repeat-x;width:57px;height:20px;line-height:20px;color:#fff;cursor:pointer;text-align:center;">评价</div>
                            </a>
                            <%
								}
							%>
                            <%
								if(!isNotEvaluate){
							%>
                            <font color="#808080">已评价</font><br/>
                            <a href="/templets/html/shop/jsp/viewcommentindex.jsp?menu_id=4865kY45B7388tV&order_no=<%=order_no%>"><font color="#BB8600">评价详细</font></a>
                            <%
								}
							%>
                          </td>
                        </tr>
                      </table></td>
                  </tr>
                  <tr>
                    <td  height="38" class="art_col"  align="right" width="20%" >支付方式:</td>
                    <td  width="18%"><%=pay_name%></td>
                    <td  height="38" class="art_col" width="12%" align="right" >配送方式:</td>
                    <td  width="60%"> 快递
                      <!-- <%=shipping_name%> --></td>
                  </tr>
                  <tr>
                    <td  colspan="4" height="38" >&nbsp;&nbsp;<img src="/templets/html/shop/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">收货人信息</span> </td>
                  </tr>
                  <tr>
                    <td  height="38" class="art_col"  align="right" width="20%" >收货人:</td>
                    <td  width="18%"><%=consignee%></td>
                    <td  height="38" class="art_col" width="12%" align="right" >邮编:</td>
                    <td  width="60%"><%=zip_code%></td>
                  </tr>
                  <tr>
                    <td  height="38" class="art_col"  align="right" width="20%" >地区:</td>
                    <td  colspan="3"><%=areaAttr%></td>
                  </tr>
                  <tr>
                    <td  height="38" class="art_col"  align="right" width="20%" >详细地址:</td>
                    <td  colspan="3"><%=address%></td>
                  </tr>
                  <tr>
                    <td  height="38" class="art_col"  align="right" width="20%" >手机:</td>
                    <td  width="18%"><%=cellphone%></td>
                    <td  height="38" class="art_col" width="12%" align="right" >电话:</td>
                    <td  width="60%"><%=tel%></td>
                  </tr>
                  <tr>
                    <td  height="38" class="art_col"  align="right" width="20%" >送货时间:</td>
                    <td  colspan="3"><%=best_time%></td>
                  </tr>
                  <tr>
                    <td  colspan="4" height="38" >&nbsp;&nbsp;<img src="/templets/html/shop/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">商品及费用信息</span> </td>
                  </tr>
                  <%
           
    List	goodslist = tb_ordergoodsInfo.getPersonalOrderDetail(order_no);
               if(goodslist!=null && goodslist.size()>0){
 
            %>
                     
                        <%
           	   

					for(int k=0;k<goodslist.size();k++){
						HashMap gmap = (HashMap)goodslist.get(k);
						String trade_id="",goods_id="",goods_state="",goods_name="",goods_attr="",goods_num="",shop_price="",sale_cust_id="";
						String file_path = "",in_date="";
						if(gmap.get("trade_id")!=null) trade_id = gmap.get("trade_id").toString();
						if(gmap.get("goods_id")!=null) goods_id = gmap.get("goods_id").toString();
						Map ginfoMap = goodsIndex.getOneGoods(goods_id);
						if (ginfoMap.get("cust_id") != null && !ginfoMap.get("cust_id").toString().equals("")) sale_cust_id = ginfoMap.get("cust_id").toString();
						if(gmap.get("goods_name")!=null) goods_name = gmap.get("goods_name").toString();
						if(gmap.get("goods_num")!=null) goods_num = gmap.get("goods_num").toString();
						if(gmap.get("shop_price")!=null) shop_price = gmap.get("shop_price").toString();
						if(gmap.get("goods_attr")!=null) goods_attr = gmap.get("goods_attr").toString();
	
						if(gmap.get("file_path")!=null) file_path = gmap.get("file_path").toString();
						if(gmap.get("in_date")!=null) in_date = gmap.get("in_date").toString();
						if(in_date.length()>10)in_date=in_date.substring(0,10);
						
					 
						String infoUrl="";
						if (sale_cust_id.equals("100000000000000"))
						{
						 	infoUrl=goods_article_path+in_date+"/"+goods_id+".html";
						}
					else
						{
							infoUrl= custrootpath+sale_cust_id+"/goods/"+ in_date + "/"+ goods_id + ".html";
						}
						
						if(file_path.equals(""))
						{
							file_path ="/program/admin/images/cpwu.gif";            
						}
	
	                   String attr_str =ts_categoryattrInfo.getCatAttrFromStr(goods_attr,6); 
	           	   
           	   
           	    
           	    %>
                        <tr>
                          <td width='10%' height=120 align='right' ><a href="<%=infoUrl%>" target="_blank"><img src="<%=file_path%>" width="80" height="80" border="0"/></a> </td>
                          <td height=120 colspan="3" ><span style="color:#303A43;">商品信息: </span> &nbsp; <span style="color:#666666;"> <a href="<%=infoUrl%>" target="_blank" ><font class="goods_name<%=k %>"><%=goods_name%></font></a><br/>
                            <%=attr_str%> </span>
                            <div style="margin-top:3px;"></div>
                            <span style="color:#303A43;">单价: </span> &nbsp; <span style="color:#666666;">￥<%=shop_price%></span>
                            <div style="margin-top:3px;"></div>
                            <span style="color:#303A43;">数量:</span> &nbsp; <span style="color:#666666;"><%=goods_num%></span> </td>
                        </tr>
                        <%
				 
       }
				        
				        %>
                        <tr>
                          <td width='10%'  align='right'>订单费用总计</td>
                          <td colspan="3"><div style="margin-top:3px;"></div>
                            <span style="color:#303A43; line-height:30px">商品总价</span><span  class="de">￥<%=all_goods_amount%></span> <span style="color:#95805D">+</span> <span style="color:#303A43;">配送总费用</span> <span class="de">￥<%=all_shipping_fee%></span> <span style="color:#95805D">+</span> <span style="color:#303A43;">包装总费用</span> <span class="de">￥ <%=all_pack_fee%></span>
                            <!--	<span style="color:#95805D">+</span> <span style="color:#303A43;">发票总税额</span> 
<span class="de">￥ <%=all_tax_invoice%></span> -->
                            <div style="margin-top:3px;"></div>
                            <span style="color:#95805D">=</span> <span style="color:#303A43;">订单总金额 </span> <span class="de">￥ <%=all_total_amount%></span> <span style="color:#95805D">-</span> <span style="color:#303A43;">已付款总金额</span> <span class="de"> ￥<%=all_paid_amount%></span> <span style="color:#95805D">=</span> <span style="color:#303A43;">应付款总金额</span> <span class="de"> ￥<%=all_confirm_money%></span> </td>
                        </tr>
                      <%
           	 
           	    }       	
           
           	%>
                    </td>
                  </tr>
                  <tr>
                    <td  colspan="4" height="38" >&nbsp;&nbsp;<img src="/templets/html/shop/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">其他信息</span> </td>
                  </tr>
                  <tr>
                    <td  height="38" class="art_col"  align="right" width="20%" >缺货处理:</td>
                    <td  colspan="3"><%
						    if(how_oos.equals("0"))out.print("等待所有商品备齐后再发");
						    if(how_oos.equals("1"))out.print("取消订单");				 
							if(how_oos.equals("2"))out.print("与店主协商");
				       %>
                    </td>
                  </tr>
                </table></td>
            </tr>
            <tr>
              <td height="50" align="center"><input type="button" name="Submit2" value="返 回" class="btn_right" onclick="history.go(-1);">
              </td>
            </tr>
          </table>
        </DIV>
      </DIV>
    </DIV>
  </div>
</div>
<form action="/program/jsalipay/index.jsp" name="payment" method="post" target="_blank">
  <input type="hidden" name="out_trade_no" id="out_trade_no" value=""/>
  <input type="hidden" name="price" id="price" value=""/>
  <input type="hidden" name="subject" id="subject" value=""/>
  <input type="hidden" name="logistics_fee" id="logistics_fee" value=""/>
  <input type="hidden" name="logistics_type" id="logistics_type" value=""/>
</form>
<script type="text/javascript">
	function pay(order_no,prices,logistics_fee,logistics_type,i){
		var str = "";
		$(".goods_name"+i).each(function(index){
			str = str + $(this).html()+"|";
		});
		$("#out_trade_no").val(order_no);
		$("#price").val(prices);
		$("#subject").val(str);
		$("#logistics_fee").val(logistics_fee);
		$("#logistics_type").val(logistics_type);
		document.payment.submit();
		
	}
  </script>
<!--底部开始-->
<div class="footer">
  <p>
    <%
						HashMap paraMap = new HashMap();
								HashMap contentMap = new HashMap();
								B2CHelpIndexFiles helpIndex=new B2CHelpIndexFiles();
						paraMap.put("ch_attr", "77f07U1647u8U0S|");
					    List helpList=null;
					    helpList = helpIndex.getHelpInfo(paraMap);

								if (null != helpList && helpList.size() > 0) {
									for (int i = 0; i < helpList.size(); i++) {
										contentMap = (HashMap) helpList.get(i);
										String info_id = "", title = "",hrefurl="";
										if (contentMap.get("info_id") != null)
											info_id = contentMap.get("info_id").toString();
										if (contentMap.get("title") != null)
											title = contentMap.get("title").toString();
										hrefurl = "/about/shop_help.html?info_id=" + info_id;
										%>
    <a href="<%=hrefurl%>"><%=title%></a>|
    <%
									}
								}
					 %>
  </p>
  <p>版权所有 (C) 北京象网无限信息技术有限责任公司 京ICP证100483 </p>
  <p><img src="/templets/html/shop/images/jc01.gif" /><img src="/templets/html/shop/images/jc02.gif" /><img src="/templets/html/shop/images/jc03.gif" /></p>
</div>
<!--底部结束-->
</body>
</html>
